package com.vn.gofriends.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.vn.gofriends.R;

public class MenuAdapter extends BaseAdapter {
	String[] nameMenu;
	int[] imgeMenu;
	Context context;

	public MenuAdapter(Context context, String[] nameMenu, int[] imgeMenu) {
		this.nameMenu = nameMenu;
		this.imgeMenu = imgeMenu;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return nameMenu.length;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

		View row;
		row = inflater.inflate(R.layout.item_gridview_menu, arg2, false);
		TextView txtnameMenu;
		ImageView imgLogoMenu;
		txtnameMenu = (TextView) row.findViewById(R.id.txtNameMenu);
		imgLogoMenu = (ImageView) row.findViewById(R.id.imgLogoMenu);
		txtnameMenu.setText(nameMenu[arg0]);
		///imgLogoMenu.setImageResource(imgeMenu[arg0]);

		return (row);
	}

}
